package com.nts.visionworks.business.endpoint.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Min;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * BuildingFloorImage generated by hbm2java
 */
@Entity
@Table(name = "building_floor_image", catalog = "visionworks")
public class BuildingFloorImage implements java.io.Serializable
{

	private BuildingFloorImageId id;
	private BuildingFloor buildingFloor;
	private int displayOrder;

	public BuildingFloorImage()
	{
	}

	public BuildingFloorImage(BuildingFloorImageId id,
			BuildingFloor buildingFloor, int displayOrder)
	{
		this.id = id;
		this.buildingFloor = buildingFloor;
		this.displayOrder = displayOrder;
	}

	@EmbeddedId
	@AttributeOverrides(
	{
			@AttributeOverride(name = "floorId", column = @Column(name = "FloorId", nullable = false)),
			@AttributeOverride(name = "imageArchiveId", column = @Column(name = "ImageArchiveId", nullable = false)) })
	public BuildingFloorImageId getId()
	{
		return this.id;
	}

	public void setId(BuildingFloorImageId id)
	{
		this.id = id;
	}

	@EntityIdNotNull(message = "validation.endPoint.buildingFloorImage.buildingFloor.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FloorId", nullable = false, insertable = false, updatable = false)
	public BuildingFloor getBuildingFloor()
	{
		return this.buildingFloor;
	}

	public void setBuildingFloor(BuildingFloor buildingFloor)
	{
		this.buildingFloor = buildingFloor;
	}

	@Min(message = "validation.endPoint.buildingFloorImage.displayOrder.min", value = 1)
	@Column(name = "DisplayOrder", nullable = false)
	public int getDisplayOrder()
	{
		return this.displayOrder;
	}

	public void setDisplayOrder(int displayOrder)
	{
		this.displayOrder = displayOrder;
	}

}
